package com.cyou.qb.common.domain;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class Active  implements Serializable{
	/**
	 * serialVersionUID: TODO(something about description)
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private String activeName;//活动名称
	private String gameCode;//对应的游戏gamecode
	private String gameName;//游戏名称
	private String gameType;//游戏类型
	private String gameComOp;//游戏运营商
	private String gameComRd;//游戏开发商
	private String gameChannel;//游戏专区
	private String gameNet;//游戏官网
	private String gameBBS;//游戏bbs
	private String gameDown;//游戏下载地址
	private String image1;//列表展示图
	private String image2;//游戏top大图
	private String image2Link;//top图链接
	private Date startTime;//活动开始时间
	private Date endTime;//活动结束时间
	private String memo;//活动描述
	private String introduce;//活动介绍
	private int status;//活动状态
	private int publish;//活动发布
	private int gMax;//活动金币
	private int adminId;//活动创建人id
	private String rule;//活动规则
	private int faceNum;//活动商城通讯id
	private int drawNum=0;//抽奖次数，数据库不准确，进行中的活动数据值有延迟
	private Date createDate;//创建时间
	
	
	//瞬时属性
	private List<ActiveRule> ruleList ;
	
//	public static String ruleList2RuleJson(){};
	
//	private String indexStr;
//	
//	
//	public void parseRule(){
//		// rule=>ruleList
//		//indexStr  1,4,5
//	}
	
	public String getFrontOneDay(){
		return new SimpleDateFormat("HH时mm分ss秒").format(new Date(this.getEndTime().getTime() - new Date().getTime()));
	}
	public String getFrontStartTime(){
		return new SimpleDateFormat("MM.dd").format(this.getStartTime());
	}
	public String getFrontEndTime(){
		return new SimpleDateFormat("MM.dd").format(this.getEndTime());
	}
	public String getActiveName() {
		return activeName;
	}
	public void setActiveName(String activeName) {
		this.activeName = activeName;
	}
	public String getGameCode() {
		return gameCode;
	}
	public void setGameCode(String gameCode) {
		this.gameCode = gameCode;
	}

	public String getGameName() {
		return gameName;
	}
	public void setGameName(String gameName) {
		this.gameName = gameName;
	}
	public String getGameType() {
		return gameType;
	}
	public void setGameType(String gameType) {
		this.gameType = gameType;
	}
	public String getGameComOp() {
		return gameComOp;
	}
	public void setGameComOp(String gameComOp) {
		this.gameComOp = gameComOp;
	}
	public String getGameComRd() {
		return gameComRd;
	}
	public void setGameComRd(String gameComRd) {
		this.gameComRd = gameComRd;
	}
	public String getGameChannel() {
		return gameChannel;
	}
	public void setGameChannel(String gameChannel) {
		this.gameChannel = gameChannel;
	}
	public String getGameNet() {
		return gameNet;
	}
	public void setGameNet(String gameNet) {
		this.gameNet = gameNet;
	}
	public String getGameBBS() {
		return gameBBS;
	}
	public void setGameBBS(String gameBBS) {
		this.gameBBS = gameBBS;
	}
	public String getGameDown() {
		return gameDown;
	}
	public void setGameDown(String gameDown) {
		this.gameDown = gameDown;
	}
	public String getImage1() {
		return image1;
	}
	public void setImage1(String image1) {
		this.image1 = image1;
	}
	public String getImage2() {
		return image2;
	}
	public void setImage2(String image2) {
		this.image2 = image2;
	}
	public String getImage2Link() {
		return image2Link;
	}
	public void setImage2Link(String image2Link) {
		this.image2Link = image2Link;
	}
	public Date getStartTime() {
		return startTime;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	public Date getEndTime() {
		return endTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	public String getMemo() {
		return memo;
	}
	public void setMemo(String memo) {
		this.memo = memo;
	}
	public String getIntroduce() {
		return introduce;
	}
	public void setIntroduce(String introduce) {
		this.introduce = introduce;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public int getPublish() {
		return publish;
	}
	public void setPublish(int publish) {
		this.publish = publish;
	}
	public int getgMax() {
		return gMax;
	}
	public void setgMax(int gMax) {
		this.gMax = gMax;
	}
	public int getAdminId() {
		return adminId;
	}
	public void setAdminId(int adminId) {
		this.adminId = adminId;
	}
	public String getRule() {
		return rule;
	}
	public void setRule(String rule) {
		this.rule = rule;
	}
	public int getFaceNum() {
		return faceNum;
	}
	public void setFaceNum(int faceNum) {
		this.faceNum = faceNum;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public int getDrawNum() {
		return drawNum;
	}
	public void setDrawNum(int drawNum) {
		this.drawNum = drawNum;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Integer getId() {
		return id;
	}
	
	public boolean getActiveIsEnd(){
		if(endTime==null)
			return true;
		return endTime.getTime()<=System.currentTimeMillis() || status == 0;
	}
}